home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d13
/
ptv2n1.arc
/
BASEOBJ.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-03-26
|
998b
|
47 lines
unit BaseObj;
{ Define a standard base object type for all other objects
to derive from. }
interface
type BasePtr = ^Base;
Base = object
destructor Done; virtual;
function ShallowClone: BasePtr;
function DeepClone: BasePtr; virtual;
function Clone: BasePtr; virtual;
end;
implementation
destructor Base.Done;
{ Free the memory allocated to an object. }
begin
end;
function Base.ShallowClone: BasePtr;
{ Return a pointer to a shallow clone of Self. }
var TempPtr: BasePtr;
begin
getmem(TempPtr,sizeof(self));
move(self,TempPtr^,sizeof(self));
ShallowClone := TempPtr
end;
function Base.DeepClone: BasePtr;
{ Return a pointer to a deep clone of Self.
Defaults to ShallowClone. }
begin
DeepClone := ShallowClone
end;
function Base.Clone: BasePtr;
{ Return a pointer to a normal clone of Self.
Defaults to ShallowClone. }
begin
Clone := ShallowClone
end;
end.